package na.learn.java.sorting;

import java.util.Comparator;

public class SortableImpl2 implements  Comparable {

	private String stringMessage;

	private static StringComparator comparator;

	public SortableImpl2() {
		comparator = new StringComparator();
	}
	
	public SortableImpl2(String message) {
		comparator = new StringComparator();
		this.stringMessage = new String(message);
	}
	

	public Comparator getComparator() {

		return comparator;
	}

	public String getStringMessage() { 
		return stringMessage;
	}

	public void setStringMessage(String stringMessage) {
		this.stringMessage = stringMessage;
	}

	public int compareTo(Object arg0) {
		
		return stringMessage.compareTo(((SortableImpl2)arg0).getStringMessage());
	}

}
